package Builder;

class SandwichBuilder{
    private int Size;
    private boolean cheese = false;
    private boolean bacon = false;
    private boolean tomato = false;
    private boolean lettuce = false;

    public SandwichBuilder setSize(int Size){
        this.Size = Size;
        return this;
    }

    public SandwichBuilder addCheese(){
        this.cheese = true;
        return this;
    }

    public SandwichBuilder addBacon(){
        this.bacon = true;
        return this;
    }
    public SandwichBuilder addTomato(){
        this.tomato = true;
        return this;
    }
    public SandwichBuilder addLettuce(){
        this.lettuce = true;
        return this;
    }


    public int getSize(){
        return Size;
    }
    public boolean hasCheese(){
        return cheese;
    }
    public boolean hasBacon(){
        return bacon;
    }
    public boolean hasTomato(){
        return tomato;
    }
    public boolean hasLettuce(){
        return lettuce;
    }

    public Sandwich build(){
        return new Sandwich(this);
    }
}